import unittest
import common


class MyTestCase(unittest.TestCase):
    def test_tip(self):
        common.print_cmd()

    def test_is_db_awailable(self):
        print(common.is_db_awailable("../__main__.py"))
        print(common.is_db_awailable("../main1.py"))
        print(common.is_db_awailable("./test.db"))

    def test_is_tb_awailable(self):
        print(common.is_tb_awailable("./test.db", "abc"))
        print(common.is_tb_awailable("./test.db", "tourist_spot"))
        pass

    def test_is_col_awailable(self):
        print(common.is_col_awailable("./test.db", "tourist_spot", "id"))
        print(common.is_col_awailable("./test.db", "tourist_spot", "a"))
        print(common.is_col_awailable("./test.db", "tourist_spot", "45"))
        pass

    def test_generate_identifiers(self):
        print(common.generate_identifier(10, 8))

    def test_get_row_count(self):
        print(common.get_row_count("./test.db", "tourist_spot"))
        pass

    def test_get_ranges(self):
        print(common.get_ranges(66306, 10))

    def test_get_current_ip(self):
        print(common.get_current_ip())


if __name__ == '__main__':
    unittest.main()
